From 3441c3f2c4ca299c3e94ceccba4b419f20ae3a07 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 14 Dec 1998 01:32:24 +0000 Subject: [PATCH] Added a "grab_focus" signal for widgets. When the signal is emitted, the 1998-12-13 Federico Mena Quintero * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" signal for widgets. When the signal is emitted, the widget will grab the focus. This is needed to let the user press an accelerator key in a dialog box and have the corresponding widget be focused. * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" signal. The default handler is simply gtk_widget_grab_focus(). --- ChangeLog | 11 +++++++++++ ChangeLog.pre-2-0 | 11 +++++++++++ ChangeLog.pre-2-10 | 11 +++++++++++ ChangeLog.pre-2-2 | 11 +++++++++++ ChangeLog.pre-2-4 | 11 +++++++++++ ChangeLog.pre-2-6 | 11 +++++++++++ ChangeLog.pre-2-8 | 11 +++++++++++ gtk/gtkwidget.c | 9 +++++++++ gtk/gtkwidget.h | 3 +++ 9 files changed, 89 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 84aff68b8f..39052ae0c0 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +1998-12-13 Federico Mena Quintero + + * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" + signal for widgets. When the signal is emitted, the widget will + grab the focus. This is needed to let the user press an + accelerator key in a dialog box and have the corresponding widget + be focused. + + * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" + signal. The default handler is simply gtk_widget_grab_focus(). + Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 9a400079d2..b0797fe66d 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -52,6 +52,7 @@ enum { STYLE_SET, ADD_ACCELERATOR, REMOVE_ACCELERATOR, + GRAB_FOCUS, EVENT, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, @@ -387,6 +388,13 @@ gtk_widget_class_init (GtkWidgetClass *klass) widget_signals[REMOVE_ACCELERATOR] = gtk_accel_group_create_remove (object_class->type, GTK_RUN_LAST, GTK_SIGNAL_OFFSET (GtkWidgetClass, remove_accelerator)); + widget_signals[GRAB_FOCUS] = + gtk_signal_new ("grab_focus", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (GtkWidgetClass, grab_focus), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); widget_signals[EVENT] = gtk_signal_new ("event", GTK_RUN_LAST, @@ -721,6 +729,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) klass->style_set = gtk_widget_style_set; klass->add_accelerator = (void*) gtk_accel_group_handle_add; klass->remove_accelerator = (void*) gtk_accel_group_handle_remove; + klass->grab_focus = gtk_widget_grab_focus; klass->event = NULL; klass->button_press_event = NULL; klass->button_release_event = NULL; diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 186e62c0bd..295a29fc34 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -272,6 +272,9 @@ struct _GtkWidgetClass GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods); + + /* explicit focus */ + void (* grab_focus) (GtkWidget *widget); /* events */ gint (* event) (GtkWidget *widget, -- 2.30.2